<template>
    <el-main>
      <el-table :data="users">
        <el-table-column prop="sysUserName" label="用户名" width="140">
        </el-table-column>
        <el-table-column prop="gender" label="性别" width="120">
        </el-table-column>
        <el-table-column prop="createTime" label="注册时间">
        </el-table-column>
      </el-table>
    </el-main>
</template>
<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
</style>

<script>
  import axios from 'axios'
  export default {
    data() {
    
     
      const users = [];
      return {
        users
      }
    },
    mounted(){
        axios.post("http://47.110.232.77:8080/index/show").then(resp => {
        console.log(resp.data.object)
        if(resp.data.code == "200")
        {
         
          this.users = resp.data.object
            
        }
    }).then(
        ()=>{
            for (var i=0;i<this.users.length;i++){
            var dataee=new Date(this.users[i].createTime).toJSON();
            this.users[i].createTime = new Date(+new Date(dataee)+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,'');
            if(this.users[i].gender == "1"){
                this.users[i].gender = "男"
            }else{
                this.users[i].gender = "女"
            }
          }
        }
    )
    
    }
  };
</script>